<?php
#file: 20180207.log
#{"SERVER_INFO":"192.168.33.3:80","HTTP_HOST":"localtrunk.lecuntao.com","time":"2017-03-10 09:45:10","ip":"192.168.33.1","session":    [],"REQUEST_METHOD":"POST","REQUEST_URI":"\/shop\/index.php?act=goods&op=show_goods_class","request_params":[],"level":"ERROR","lo    gmessage":{"logmessage":{"logKey":"[throw_exception]","desc":"Db Error: database connect failed=@@@=Db Error: database connect fai    led","parameters":{"act":"goods","op":"show_goods_class"}}}}
#{"SERVER_INFO":"192.168.33.3:80","HTTP_HOST":"localtrunk.lecuntao.com","time":"2017-03-10 09:45:10","ip":"192.168.33.1","session":    [],"REQUEST_METHOD":"POST","REQUEST_URI":"\/shop\/index.php?act=goods&op=show_goods_class","request_params":[],"level":"ERROR","lo    gmessage":{"logmessage":{"logKey":"[throw_exception]","desc":"Db Error: =@@@=Db Error: ","parameters":{"act":"goods","op":"show_go    ods_class"}}}}
#
#cat 20180207.log | php ~/tools/checklog.php
$handle = @fopen("php://stdin", "r");
if ($handle) {
    while (($buffer = fgets($handle, 4096)) !== false) {
	print_r(json_decode($buffer, true));
    }
    fclose($handle);
}
